﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.IO.IsolatedStorage;
namespace Microsoft.TownHall.ServiceClient
{
    [XmlRoot("Users")]
    public class UserList : List<User> { }
    
    [XmlRoot("User")]
    public class User
    {
        [XmlElement(ElementName="UserID", Type=typeof(int))]
        public int UserID { get; set; }
        
        [XmlElement(ElementName="DisplayName")]
        public string DisplayName { get; set; }
        
        [XmlElement(ElementName="DisplayNameSlug")]
        public string DisplayNameSlug { get; set; }

        [XmlElement(ElementName = "IsAnonymous", Type = typeof(bool))]
        public bool IsAnonymous { get; set; }

        [XmlElement(ElementName = "IsUnder13", Type = typeof(bool))]
        public bool IsUnder13 { get; set; }
        
        [XmlElement(ElementName = "ReputationTotal", Type = typeof(long))]
        public long ReputationTotal { get; set; }

        [XmlArray("OpenIDUrls")]
        [XmlArrayItem("OpenIDUrl", Type = typeof(string))]
        public List<string> OpenIDUrls { get; set; }
 
        [XmlElement(ElementName = "AccountIdentifier", IsNullable = true)]
        public string AccountIdentifier { get; set; }

        [XmlElement(ElementName = "Avatar", Type = typeof(string))]
        public string Avatar { get; set; }

        [XmlElement(ElementName = "CitizenType", Type = typeof(string))]
        public string CitizenType { get; set; }
        [XmlElement(ElementName="DateCreated", Type=typeof(DateTime))]
        public DateTime DateCreated { get; set; }
        [XmlElement(ElementName="DateLastSeen", Type=typeof(DateTime))]
        public DateTime DateLastSeen { get; set; }

        [XmlElement(ElementName = "Email", Type = typeof(String))]
        public string Email { get; set; }

        [XmlElement(ElementName = "ParentEmail", Type = typeof(String))]
        public string ParentEmail { get; set; }

        [XmlElement(ElementName = "IsBlocked", Type = typeof(bool))]
        public bool IsBlocked { get; set; }

        public BadgeList Badges { get; set; }
        public RegistrationPropertyList RegistrationProperties { get; set; }
    
    }
}
